[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
cosh() Calculate Hyperbolic Cosine
#include <math.h>
double cosh(x); Hyperbolic cosine
double x; Radians
cosh() returns the hyperbolic cosine of 'x' radians.
Returns: Hyperbolic cosine of 'x'. If the result is too
large, matherr() is called with an OVERFLOW error,
'errno' (defined in <errno.h>) is set to ERANGE
(defined in <errno.h>), and the value 'HUGE_VAL"
(defined in <math.h>) is returned.
Notes: OVERFLOW first occurs with 'x' greater than 7.0E2.
Error handling can be modified with the matherr()
function.
-------------------------------- Example ---------------------------------
The following statements print the hyperbolic cosine of pi and 240 pi
radians, and check for overflow.
#include <math.h> /* for cosh() and ERANGE */
#include <stdio.h> /* for printf() */
#include <errno.h> /* for errno */
main()
{
double hcosine, pi = 3.1415926535;
hcosine = cosh(pi);
printf("hyperbolic cosine of pi = %e\n", hcosine);
errno = 0;
hcosine = cosh(240.0 * pi);
if (errno == ERANGE)
printf("ERANGE error in cosh()\n");
printf("hyperbolic cosine of 240 * pi = %e\n", hcosine);
}
See Also:
acos()
cos()
matherr()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson